package com.aaa.controller;

import com.aaa.entity.Address;
import com.aaa.entity.User;
import com.aaa.service.impl.AddressServiceImpl;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("address")
@Controller
public class AddressController {
    @Resource
    AddressServiceImpl addressService;
    @RequestMapping("saveOrUpdate")
    @ResponseBody
    public boolean add(Address address){
boolean i= addressService.saveOrUpdate(address);
        return i;
    }
    @RequestMapping("edit")
    @ResponseBody
    public boolean update(Address address){
        return addressService.updateById(address);
    }
    @RequestMapping("delete")
    @ResponseBody
    public boolean delete(Integer addressid){
        return addressService.removeById(addressid);
    }
    @RequestMapping("sel")
    @ResponseBody
    public List<Address> sel(Address address){
        List<Address> list=addressService.sel(address);
        return list;
    }
}
